package main

import (
	"fmt"
	"net/http"
)

// go语言实现 http服务端
func startHttp() {
	fmt.Println("网络错误")
	//注册路由
	http.HandleFunc("/", sayhello)
	//建立监听
	err := http.ListenAndServe("127.0.0.1:8080", nil)

	if err != nil {
		fmt.Println("网络错误")
		return
	}

}

func sayhello(writer http.ResponseWriter, request *http.Request) {
	writer.Write([]byte(`{"ticketMain":{"id":558,"name":"COMICUP 29","eventName":"COMICUP 29","description":"<p>购票须填写真实的身份信息以及手机号，购票后不支持更换身份证信息，且同一票种一个身份证限购1张&nbsp;</p><p>票种说明</p><p>VIP票：每个ID限购2张，同个身份证信息限购1张。最早入场时间较普通票提前30分钟，VIP专属检票口免排队（详见现场指示牌）全套购票特典（CPP无差别同人站展台场取，共六款）</p><p>普通票：每个ID限购4张，同个身份证信息限购1张。参考入场时间10点。以现场情况为准。购票特典（CPP无差别同人站展台场取，六款任选3张）</p><p>DAY1+DAY2优惠套餐：每个ID限购4张，同个身份证信息限购1张。参考入场时间10点。以现场情况为准。全套购票特典（CPP无差别同人站展台场取，共六款）&nbsp;</p><p>退票说明&nbsp;</p><p>1、用户自身原因退换票</p><p>CPP购买的电子票售出后不支持退换，如果因为您这边的自身原因需要退票的话，CPP会收取相应手续费。</p><p>退票时间以及手续费收取标准明细标准：</p><p>申请退票日期距离开展大于30天收取6%的手续费；</p><p>申请退票日期距离开展大于15天小于30天含第30天收取10%；</p><p>申请退票日期距离开展大于10天小于15天含第15天收取15%；</p><p>申请退票日期早于4月30日0点的收取30%；</p><p>申请退票日期在4月30日0点至5月1日24点的收取60%；</p><p>申请退票日期在5月2日0点之后的收取100%</p><p>（详见《无差别同人站社区规则》https://www.allcpp.cn/w/141382.do</p><p>如您确认要退票的话，站方将会在展后3—7个工作日内核实并为您完成退款，扣除手续费后的款项会原路退回给您。 如您在其他平台购票还请咨询其他平台客服哦</p><p>2、非个人原因退换票</p><p>如因活动变更、活动取消、票品错误、或任何不可抗力因素（如自然灾害、交通戒严、疫情防控、突发战争）等原因发生退换则网站将会全额退票。</p><p><br/></p>","eventDescription":"<p>门票信息：</p><p>·单日普通票=78元&nbsp; ·单日VIP票=158元&nbsp; ·Day1+Day2优惠套票=136元</p><p>※入场需要核验有效且与预约登记一致的本人身份证件，刷身份证及人脸识别入场，请务必携带且保管好个人身份证件</p><p>※特别提醒：现场人流较大，为确保您和他人的安全，非必要请勿使用代步工具，将有限的空间留给有需要的游客。使用轮椅入场的游客建议提前准备好残疾证或医院开具的病情证明，方便馆方安保人员核查。</p><p><br/></p>","coverPicId":0,"coverPicUrl":"","picId":0,"priority":1000,"enabled":1,"eventMainId":1074,"type":0,"createTime":1682600251846,"updateTime":1682600251846,"confirmableVO":null},"ticketTypeList":[{"id":1904,"eventId":1200,"ticketMainId":558,"ticketName":"DAY1 VIP票","ticketAttribute":1,"ticketPrice":15800,"purchaseNum":2,"remainderNum":500,"lockNum":0,"session":0,"sellStartTime":1682651070000,"sellEndTime":1682956800000,"ticketDescription":"随票赠送全套（6张）无料","ticketGPStartTime":1682956800000,"ticketGPEndTime":1683018000000,"realnameAuth":true,"square":"","createTime":null,"updateTime":1682604131995},{"id":1905,"eventId":1201,"ticketMainId":558,"ticketName":"DAY2 VIP票","ticketAttribute":1,"ticketPrice":15800,"purchaseNum":2,"remainderNum":496,"lockNum":0,"session":0,"sellStartTime":1682651070000,"sellEndTime":1683043200000,"ticketDescription":"随票赠送全套（6张）无料","ticketGPStartTime":1683043200000,"ticketGPEndTime":1683104400000,"realnameAuth":true,"square":"","createTime":null,"updateTime":1682604187937},{"id":1906,"eventId":1200,"ticketMainId":558,"ticketName":"DAY1 普通票","ticketAttribute":1,"ticketPrice":7800,"purchaseNum":4,"remainderNum":19999,"lockNum":0,"session":0,"sellStartTime":1682651070000,"sellEndTime":1682956800000,"ticketDescription":"随票赠送3张同人无料，款式任选，先到先得","ticketGPStartTime":1682956800000,"ticketGPEndTime":1683018000000,"realnameAuth":true,"square":"","createTime":null,"updateTime":1682605800420},{"id":1907,"eventId":1201,"ticketMainId":558,"ticketName":"DAY2 普通票","ticketAttribute":1,"ticketPrice":7800,"purchaseNum":4,"remainderNum":15000,"lockNum":0,"session":0,"sellStartTime":1682651070000,"sellEndTime":1682956800000,"ticketDescription":"随票赠送3张同人无料，款式任选，先到先得","ticketGPStartTime":1683043200000,"ticketGPEndTime":1683104400000,"realnameAuth":true,"square":"","createTime":null,"updateTime":1682603955618},{"id":1908,"eventId":1200,"ticketMainId":558,"ticketName":"DAY1+DAY2 普通票","ticketAttribute":1,"ticketPrice":13600,"purchaseNum":4,"remainderNum":999,"lockNum":0,"session":1,"sellStartTime":1682651070000,"sellEndTime":1682956800000,"ticketDescription":"随票赠送全套（6张）无料","ticketGPStartTime":1682956800000,"ticketGPEndTime":1683104400000,"realnameAuth":true,"square":"","createTime":null,"updateTime":1682605800459}]}`))
	//fmt.Fprint(writer,"<p style='color:red;'>你好啊哈哈哈哈哈</p>")

}
